package main

import "fmt"

func main() {
	var array [8]int
	for i := range array {
		array[i] = 1 + i
	}

	for i := range array {
		fmt.Println("array[", i, "] = ", array[i])
	}
	//一维数组初始化
	var array1 [6]int = [6]int{1, 2, 3, 4, 5, 6}
	for i, i2 := range array1 {
		fmt.Println(i, ":", i2)
	}
	//二维数组初始化
	var array2 = [2][2]int{{1, 2}, {2, 3}}
	for i := range array2 {
		fmt.Println(i, array2[i])
	}
}
